
#import <Foundation/Foundation.h>
#import <netinet/in.h>
#import <sys/socket.h>

@interface ServerController : NSObject  <NSNetServiceDelegate> {
    NSNetService *netService;
    NSSocketPort *netSocket;
    struct sockaddr *addr;
}

@property (nonatomic, assign, readwrite) BOOL server;

// basic
-(void) startService;
-(void) stopService;

// NSNetService delegate methods
-(void) netServiceWillPublish:(NSNetService*) sender;
-(void) netService:(NSNetService*) sender didNotPublish:(NSDictionary *)errorDict;
-(void) netServiceDidPublish:(NSNetService*) sender;
-(void) netServiceWillResolve:(NSNetService*) sender;
-(void) netService:(NSNetService*) sender didNotResolve:(NSNetService*) sender;
-(void) netServiceDidResolveAddress:(NSNetService*) sender;
-(void) netService:(NSNetService*) sender didUpdateTXTRecordData:(NSNetService*) sender;
-(void) netServiceDidStop:(NSNetService*) sender;

@end
